package adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bean.PrePareBeans;
import bean.WorkBean;
import student.andlei.com.student.R;
import utils.GlideUtils;

public class WorkAdapter  extends BaseQuickAdapter<WorkBean,BaseViewHolder> {
    private Context context;
    public WorkAdapter(Context context, int layoutResId, @Nullable List<WorkBean> data) {
        super(layoutResId, data);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, WorkBean item) {
        ImageView imageView = helper.getView(R.id.img_subject);
        GlideUtils.loadImageViewNoteLoding(context,item.subject_image,imageView);
        helper.setText(R.id.tv_subject,item.subject_name);
        helper.setText(R.id.tv_finish,"已完成："+item.finished+"份");
        helper.setText(R.id.tv_nofinish,"未完成："+item.unfinished+"份");
    }
}
